package com.yixing.tech.common.entity;

import lombok.Data;
import org.bson.types.ObjectId;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author yixing tech
 * @since 1.0.0
 */
@Data
public class ErpRawInStock implements Serializable {
    private String RuleCode;
    private String SourceBillId;
    private String BizDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());

    private String BizType;
    private String TransactionType;
    private String CostCenterOrgUnit;
    private String StorageOrgUnit;
    private String AdminOrgUnit;

    private List<ErpRawInStockEntry> entrys;

    public static ErpRawInStock demo() {
        ErpRawInStock stock = new ErpRawInStock();
        stock.setRuleCode(new ObjectId().toString());
        stock.setSourceBillId(new ObjectId().toString());
        stock.setBizDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        ErpRawInStockEntry entry = new ErpRawInStockEntry();
        entry.setSourceEntryId(new ObjectId().toString());
        entry.setMaterial(new ObjectId().toString());
        entry.setQty("12");
        entry.setWarehouse("erpHouse");
        stock.setEntrys(Arrays.asList(entry));
        return stock;
    }

}
